package com.jieyun.rbac.param;

import java.io.Serializable;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * 系统用户param
 * 
 * @author trek
 *
 */

@Data
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@SuppressWarnings("serial")
public class SysUserParam implements Serializable {
	// id
	@NotBlank(message = "用户的id不能为空", groups = UserUpdate.class)
	private Integer id;
	// 用户名
	@NotBlank(message = "用户名不能为空", groups = UserAdd.class)
	private String username;

	@NotBlank(message = "用户的姓名不能为空", groups = { UserUpdate.class, UserAdd.class })
	private String name;

	// 电话号码
	private String telephone;
	// 邮件
	@Email(message = "邮箱的格式不正确")
	private String mail;

	// 密码
	@NotBlank(message = "密码不能为空", groups = UserAdd.class)
	private String password;
	// 部门的id
	@NotNull(message = "部门的id不能为空", groups = UserAdd.class)
	private Integer deptId;
	// 备注
	private String remark;

	/**
	 * 用户添加组
	 */
	public interface UserAdd {
	}

	/**
	 * 用户更新组
	 */
	public interface UserUpdate {
	}
}
